#!/bin/bash

# make zip archive with necessary files

date=$(date +%Y%m%d)

dir='php-gamercard'

if [ -d $dir ] ; then
	rm $dir/* -rf
else
	mkdir $dir
fi

mkdir $dir/clearbricks/common/ $dir/clearbricks/net/ \
 $dir/clearbricks/net.http/ -p

cp clearbricks/_common.php $dir/clearbricks/_common.php
cp clearbricks/common/_main.php $dir/clearbricks/common/_main.php
cp clearbricks/net/class.net.socket.php \
 $dir/clearbricks/net/class.net.socket.php
cp clearbricks/net.http/class.net.http.php \
 $dir/clearbricks/net.http/class.net.http.php

cp class.gamercard.php gpl-2.0.txt INSTALL test.php $dir

if [ -f ../php-gamercard-$date.zip ] ; then
	rm ../php-gamercard-$date.zip
fi 

zip -r ../php-gamercard-$date.zip $dir

rm $dir -rf

echo
echo file php-gamercard-$date.zip created